

import java.lang.reflect.Constructor;
import java.lang.reflect.Method;

public class Test{
	
	public static void main(String[] args)throws Exception {
		for (Class item :Parent.class.getDeclaredClasses()) {
			System.out.println(item.getName());
			System.out.println(item.getSigners());
			System.out.println("...............");
		}
		
		Class sonClass = Parent.class.getDeclaredClasses()[0];//
		//com.sohu.cloudatlas.interceptor.Parent$Son
		Class.forName("com.sohu.cloudatlas.interceptor.Parent$Son");
		Constructor<?> constructor = sonClass.getDeclaredConstructors()[0];
		constructor.setAccessible(true);
		constructor.newInstance(new Parent());
		
		Method method = sonClass.getMethod("say", new Class[0]);
		method.invoke(constructor.newInstance(new Parent()), null);
		
		System.out.println(Parent.class.getDeclaredClasses()[0].getModifiers());
		System.out.println(Parent.class.getClasses());
		System.out.println(Parent.class.getEnclosingClass());
		System.out.println(Parent.class.getDeclaredMethods());
	}
}

class Parent {

	private class Son{
	
		public void say(){
			System.out.println("hello");
		}
		
	}
}
